package com.athena.start;

import com.athena.framework.annotation.YmlParsing;
import com.athena.framework.init.FrameworkStart;
import com.athena.tomcat.TomcatServer;
import org.apache.catalina.LifecycleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class App {

    private final static Logger logger = LoggerFactory.getLogger(App.class);


    public void run() throws LifecycleException {
        if (logger.isInfoEnabled()) {
            logger.info("程序开始启动。。。");
        }
        //初始化配置文件
        YmlParsing ymlParsing = new YmlParsing();
        ymlParsing.parsing();

        if (logger.isInfoEnabled()){
            logger.info("开始初始化framework。。。");
        }
        FrameworkStart start=new FrameworkStart();
        start.init();

        //启动tomcat
        TomcatServer server=new TomcatServer();
        server.startServer();

    }

    public static void main(String[] args) throws LifecycleException, InterruptedException {

        new App().run();

    }

}
